package com.jake.mallseckill.multithreading;

import java.util.concurrent.CountDownLatch;

public class MyWorker implements Runnable {

    String name;
    CountDownLatch countDownLatch;

    public MyWorker(String name, CountDownLatch countDownLatch) {
        this.name = name;
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        long sum = 0;
        for (int i = 1; i <= 10000000; i++) {
            sum += i;
        }
        countDownLatch.countDown();
    }

}
